--------------------------------------------------------------------
-- MINIMAP BORDER
--------------------------------------------------------------------

	local mPanel = CreateFrame("Frame", mapborder, Minimap)
	mPanel:SetFrameLevel(0)
	mPanel:SetFrameStrata("background")
	mPanel:SetAllPoints(Minimap)
	mPanel:SetScale(1)
	
	mPanel:SetBackdrop( { 
	  bgFile = BLANK_TEXTURE, 
	  edgeFile = BLANK_TEXTURE, 
	  tile = false, tileSize = 0, edgeSize = 1, 
	  insets = { left = -1, right = -1, top = -1, bottom = -1 }
	})
	mPanel:SetBackdropColor(0.1, 0.1, 0.1, 1)
	mPanel:SetBackdropBorderColor(0.1, 0.1, 0.1, 1)
	mPanel:Show()
	
	local FrameBackdrop = CreateFrame("Frame", mapborder, mPanel)
	FrameBackdrop:SetFrameLevel(0)
	FrameBackdrop:SetFrameStrata("background")
	FrameBackdrop:SetHeight(134)
	FrameBackdrop:SetAlpha(0.8)
	FrameBackdrop:SetPoint("LEFT", mPanel, "LEFT", -5, 0)
	FrameBackdrop:SetPoint("RIGHT", mPanel, "RIGHT", 5, 0)
	FrameBackdrop:SetPoint("TOP", mPanel, "TOP", 0, 5)
	FrameBackdrop:SetPoint("BOTTOM", mPanel, "BOTTOM", 0, -5)
	FrameBackdrop:SetFrameStrata("BACKGROUND")
	FrameBackdrop:SetBackdrop {
	  edgeFile = "Interface\\AddOns\\eMedia\\glowTex", edgeSize = 5,
	  insets = {left = 3, right = 3, top = 3, bottom = 3}
	}
	FrameBackdrop:SetBackdropColor(0, 0, 0, 0)
	FrameBackdrop:SetBackdropBorderColor(0, 0, 0)
--------------------------------------------------------------------
-- MINIMAP ROUND TO SQUARE AND MINIMAP SETTING
--------------------------------------------------------------------

Minimap:SetScale(0.92857143)
Minimap:SetFrameStrata("BACKGROUND")
Minimap:ClearAllPoints()
Minimap:SetPoint("TOPLEFT", UIParent, 20, -20)	


-- Hide Border
MinimapBorder:Hide()
MinimapBorderTop:Hide()

-- Hide Zoom Buttons
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()

-- Hide Voice Chat Frame
MiniMapVoiceChatFrame:Hide()

-- Hide Game Time
GameTimeFrame:Hide()

-- Hide Zone Frame
MinimapZoneTextButton:Hide()

-- Hide Tracking Button
MiniMapTracking:Hide()

-- Hide Mail Button
MiniMapMailFrame:ClearAllPoints()
MiniMapMailFrame:SetPoint("TOPRIGHT", Minimap, 3, 4)
MiniMapMailBorder:Hide()
MiniMapMailIcon:SetTexture("Interface\\AddOns\\eMap\\Textures\\mail")

MinimapCluster:ClearAllPoints()
MinimapCluster:SetPoint("TOPRIGHT", Minimap, 20, 0)

-- Move battleground icon
MiniMapBattlefieldFrame:ClearAllPoints()
MiniMapBattlefieldFrame:SetPoint("BOTTOMRIGHT", Minimap, 3, 0)

-- Hide world map button
MiniMapWorldMapButton:Hide()

function UpdateLFG()
	MiniMapLFGFrame:ClearAllPoints()
	MiniMapLFGFrame:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMRIGHT", 3, 0)
end
hooksecurefunc("MiniMapLFG_UpdateIsShown", UpdateLFG)

-- Enable mouse scrolling
Minimap:EnableMouseWheel(true)
Minimap:SetScript("OnMouseWheel", function(self, d)
	if d > 0 then
		_G.MinimapZoomIn:Click()
	elseif d < 0 then
		_G.MinimapZoomOut:Click()
	end
end)

Minimap:SetScript("OnMouseUp", function(self, btn)
	if btn == "RightButton" then
		ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self)
	elseif btn == "MiddleButton" then
		GameTimeFrame:Click() 
	else
		Minimap_OnClick(self)
	end
end)

-- Set Square Map Mask
Minimap:SetMaskTexture("Interface\\AddOns\\eMap\\Textures\\Mask.blp")











	
